package it.test.java.decoratord.student;

import java.math.BigDecimal;

/**
 * @Copyright 纳新智能科技有限公司
 * @Author Liky
 * @Date 2023/9/27
 */
public class ShuatiDecorator extends LearningDecorator{
    public ShuatiDecorator(ILearning learning) {
        super(learning);
    }

    @Override
    public BigDecimal improveScore(Student student) {
        super.improveScore(student);
        BigDecimal improvedScore = student.getScore().add(new BigDecimal("10"));
        System.out.println("通过刷题,分数提高了10,现在的分数为："+improvedScore);
        student.setScore(improvedScore);
        return improvedScore;
    }
}
